package com.ruoyi.cpsp.mapper;

import com.ruoyi.cpsp.domain.EvaluateRecordCurrentQuarter;
import com.ruoyi.cpsp.domain.EvaluateRecordRelated;
import com.ruoyi.cpsp.domain.EvaluateRecordToEmployee;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface EvaluateRecordToEmployeeMapper
{
    /**
     * 根据 evaluateRecordId 获取对于每个人的处罚
     * @param map
     * @return
     */
    List<EvaluateRecordToEmployee> selectEvaluateRecordToEmployees(Map<String, Object> map);

    /**
     * 插入数据
     * @param year
     * @param quarter
     * @param employeeIdCard
     * @param performanceValue
     */
    void insertEvaluateRecordToEmployee(@Param("year") int year, @Param("quarter") int quarter, @Param("employeeIdCard") String employeeIdCard, @Param("performanceValue") double performanceValue);

//    /**
//     * 通过处罚记录 id 获取每条具体员工处罚记录的列表
//     * @param evaluateRecordId
//     * @return
//     */
//    List<EvaluateRecordToEmployee> selectEvaluateRecordToEmployeesByEvaluateRecordId(Integer evaluateRecordId);


    List<EvaluateRecordCurrentQuarter> selectCurrentProp(Integer year, Integer quarter);


    int insertEvaluateRecordToEmployee(EvaluateRecordToEmployee record);

    int deleteInfoByRecordId(@Param("evaluateRecordId") Integer evaluateRecordId);

    int updatePropInfo(@Param("evaluateRecordId") Integer evaluateRecordId,
                       @Param("employeeIdCard") String employeeIdCard);

    List<EvaluateRecordRelated> selectRelatedEmployees(@Param("evaluateRecordId") Integer evaluateRecordId);

    int deleteRelatedEmployee(@Param("id") Integer id);

    int updateByPrimaryId(@Param("id") Integer id, @Param("proportionOfPunishment") Double proportionOfPunishment);

    List<String> selectIdCardsByRecordId(@Param("evaluateRecordId") Integer evaluateRecordId);
}
